<script setup>
const props = defineProps({
  show: Boolean,
})
</script>

<template>
  <transition name="loader">
    <div class="loading" v-show="show">
      <span class="loader"></span>
    </div>
  </transition>
</template>

<style scoped>
.loading {
  top: 0;
  left: 0;
  transition: all .5s ease-in-out;
  width: 100%;
  height: calc(100vh - 50px);
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #2c3e50;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: #3cff95;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    }

    @keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
    }

      .loader-enter-active, .loader-leave-active {
    transition: all .5s;
  }

  .loader-enter-from, .loader-leave-to {
    opacity: 0;
  }

</style>